This invention relates to flash memory devices, and more particularly, monitoring when to perform an erase operation in a flash memory device.
Flash memory devices have many advantages for a large number of applications. These advantages include their non-volatility, speed, ease of erasure and reprogramming, small physical size and related factors. There are no mechanical moving parts and as a result such systems are not subject to failures of the type most often encountered with hard disk storage systems.
Flash memory devices have many characteristics that are different from other memory devices. One major difference is that a block containing existing data in flash memory devices cannot be overwritten with new data. Existing data must be completely erased (also referred to as xe2x80x9ccleanedxe2x80x9d) from a block before data can be written into memory locations again. Blocks can only be erased a limited number of times before the flash memory device becomes unusable.
Additionally, most block erasures stalls other operations from occurring such as read and write operations to the flash memory device. Most flash memory systems attempt, therefore, to minimize erasures to specific times, such as at initialization or powering-off of a computer system; or at periodically scheduled times.
The problem with periodic scheduled erasure times is that they may occur more often than actually needed which in turn will prematurely shorten the life of a flash memory device.
The problem with scheduling erasures at initialization or powering off of a device is that they may also occur more often than needed which in turn will prematurely shorten the life of a flash memory device. They may also not occur enough in which case the flash memory device may be become full and not accept new data.
A system and method invokes an erase operation in a flash memory device by monitoring the entropic nature of the flash memory device. In one implementation, flash abstraction logic, tracks how many physical sectors are free to receive data; track how many physical sectors contain data that is dirty, and compare whether the physical sectors that are free to receive data outnumber the physical sectors that contain data that is dirty. A compactor performs an erase operation of one or more blocks when the physical sectors that contain data that is dirty outnumber the physical sectors that are free to receive data.
In another implementation, the flash abstraction logic tracks how many physical sector addresses are free to receive data, and track when the physical sector addresses that are free to receive data are insufficient in quantity to receive write requests from a file system. The compactor executes an erase operation of one or more blocks if the physical sector addresses that are free to receive data are insufficient in quantity.